import { SchemaManageAPI } from '@/components/SchemaComponent/SchemaManage/type';
import { getLevelZeroJson } from '@/utils';

/**
 * @getApplyManageSearchColumns
 * @description 申请管理数据表格信息展示和操作
 */
export const getApplyManageSearchColumns = ({ applyStateList, checkStateList, cancelTypeList, supplyWayList }: any): Array<SchemaManageAPI.ISearchList> => {
  return [
    {
      name: 'applyTitle',
      placeholder: '采购项目名称',
      label: '采购项目名称',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'expectSum',
      placeholder: '预算费用',
      label: '预算费用',
      componentType: 'NumberRange',
      allowClear: true,
      md: 8,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'supplyWay',
      placeholder: '标的来源',
      label: '标的来源',
      componentType: 'Select',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
      dataSource: supplyWayList,
    },
    {
      name: 'state',
      placeholder: '状态',
      label: '状态',
      componentType: 'Select',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
      dataSource: applyStateList,
    },

    {
      name: 'applyInfo',
      placeholder: '申请理由',
      label: '申请理由',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },
    // ======================以下高级搜索==========================
    // {
    //   name: 'applyFormName',
    //   placeholder: '创建',
    //   label: '创建',
    //   componentType: 'DeptAndUser',
    //   dataSource: getLevelZeroJson() ?? [],
    //   allowClear: true,
    //   md: 6,
    //   sm: 24,
    //   whetherSenior: true,
    //   formOrgType: {
    //     COMP: 'createCompanyID',
    //     DEPT: 'createDepartmentID',
    //     POS: 'createPositionID',
    //     USER: 'createrID',
    //   },
    // },
    // {
    //   name: 'createTime',
    //   placeholder: '',
    //   label: '创建时间',
    //   componentType: 'RangePicker',
    //   allowClear: true,
    //   md: 6,
    //   sm: 24,
    //   whetherSenior: true,
    // },
    // {
    //   name: 'applyTime',
    //   placeholder: '',
    //   label: '申请时间',
    //   componentType: 'RangePicker',
    //   allowClear: true,
    //   md: 6,
    //   sm: 24,
    //   whetherSenior: true,
    // },
    {
      name: 'applyTime',
      placeholder: '',
      label: '申请时间',
      componentType: 'RangePicker',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: true,
    },
    {
      name: 'applyFormName',
      placeholder: '申请',
      label: '申请',
      componentType: 'DeptAndUser',
      dataSource: getLevelZeroJson() ?? [],
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: true,
      formOrgType: {
        COMP: 'applyCompanyID',
        DEPT: 'applyDepartmentID',
        POS: 'applyPositionID',
        USER: 'applyerID',
      },
    },
    {
      name: 'createTime',
      placeholder: '',
      label: '创建时间',
      componentType: 'RangePicker',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: true,
    },
    {
      name: 'createFormName',
      placeholder: '创建',
      label: '创建',
      componentType: 'DeptAndUser',
      dataSource: getLevelZeroJson() ?? [],
      allowClear: true,
      md: 8,
      sm: 24,
      whetherSenior: true, //是否放到更多搜索里面
      formOrgType: {
        COMP: 'createCompanyID',
        DEPT: 'createDepartmentID',
        POS: 'createPositionID',
        USER: 'createrID',
      },
    },
    // {
    //   name: 'cancelTime',
    //   placeholder: '',
    //   label: '作废时间',
    //   componentType: 'RangePicker',
    //   allowClear: true,
    //   md: 6,
    //   sm: 24,
    //   whetherSenior: true,
    // },
    // {
    //     name: 'checkState',
    //     placeholder: '审核状态',
    //     label: '审核状态',
    //     componentType: 'Select',
    //     allowClear: true,
    //     md: 4,
    //     sm: 24,
    //     whetherSenior: true,
    //     dataSource: checkStateList,
    // },

    // {
    //     name: 'createTime',
    //     placeholder: '创建时间',
    //     label: '创建时间',
    //     componentType: 'RangePicker',
    //     allowClear: true,
    //     md: 6,
    //     sm: 24,
    //     whetherSenior: true,
    // },
    // {
    //     name: 'checkTime',
    //     placeholder: '审核时间',
    //     label: '审核时间',
    //     componentType: 'RangePicker',
    //     allowClear: true,
    //     md: 6,
    //     sm: 24,
    //     whetherSenior: true,
    // },
    // {
    //     name: 'applyTime',
    //     placeholder: '申请时间',
    //     label: '申请时间',
    //     componentType: 'RangePicker',
    //     allowClear: true,
    //     md: 6,
    //     sm: 24,
    //     whetherSenior: true,
    // },
    // {
    //     name: 'cancelTime',
    //     placeholder: '取消时间',
    //     label: '取消时间',
    //     componentType: 'RangePicker',
    //     allowClear: true,
    //     md: 6,
    //     sm: 24,
    //     whetherSenior: true,
    // },
    // {
    //     name: 'cancelTime',
    //     placeholder: '作废时间',
    //     label: '作废时间',
    //     componentType: 'RangePicker',
    //     allowClear: true,
    //     md: 6,
    //     sm: 24,
    //     whetherSenior: true,
    // },
  ];
};
